<template>
	
	<view class="h250 w100p whiteBg shadow  mt10 rds5" style="z-index: 1;">
		<swiper class="swiper h100p" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
		 :duration="duration">
			<block v-for="(x , index) in datalist" :key="index">		
				<swiper-item>
					<view class="swiper-item h100p  ">
						<image :src="x.image_url"
						 class="h100p w100p rds5 hover" @click="go(x.url)" :alt="x.title"></image>
					</view>
				</swiper-item>
			</block>
		</swiper>
	</view>
</template>

<script>
	export default {
		name: 'kenybanner',		
		props: {
			title: {
				type: String,
				default: ''
			}, // 列表标题			
			actionUrl:{
				type: String,
				default: 'api/banner/list'
			}
		},
		data() {
			return {				
				conditions: {},
				loading: true ,				
				datalist: [],
				indicatorDots: true,
				autoplay: true,
				interval: 3000,
				duration: 500,
			}
		},	
		
		created() {			
			
			this.getPage();
		},
		
		methods: {
			getPage:function(e){
				this.bcc.callInCache({
					url : this.actionUrl ,
					success : e => { 
						//console.log(e.list)
						this.datalist = e.list;
						this.loading = false ;
					}
				});
			},
			gotlist(e,name){
				
				uni.navigateTo({
					url: "/pages/web/list?id="+e+"&name="+name
				})
				
			},
			go(e){
				
				
				if(e!=='#'){
					uni.navigateTo({
						url: e
					})
				}
			}
			
			
			
		}
	}
</script>